package router

import (
	"server/application/constant/apis"
	"server/application/constant/enums"
	"server/application/controller/custctrl"
	"server/application/db/schema/sdto"
	"server/application/dto"
	"server/application/dto/requestdto"
	"server/pkg/ginp"
)

func init() {

	//创建
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountCreate,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountCreate), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      true,                                         //是否需要登录
		NeedPermission: true,                                         //是否需要鉴权
		PermissionName: "UserAccount.create",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "创建用户",
			Description: "",
			RequestDto:  sdto.UserAccountCreate{},
		},
	})

	//修改
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountUpdate,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountUpdate), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      true,                                         //是否需要登录
		NeedPermission: true,                                         //是否需要鉴权
		PermissionName: "UserAccount.update",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "修改用户",
			Description: "",
			RequestDto:  sdto.UserAccountUpdate{},
		},
	})

	// 删除
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountDelete,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountDelete), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      true,                                         //是否需要登录
		NeedPermission: true,                                         //是否需要鉴权
		PermissionName: "UserAccount.delete",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "删除用户",
			Description: "",
			RequestDto:  sdto.UserAccountDelete{},
		},
	})

	//search 搜索
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountSearch,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountSearch), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      true,                                         //是否需要登录
		NeedPermission: true,                                         //是否需要鉴权
		PermissionName: "UserAccount.search",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "获取用户列表",
			Description: "",
			RequestDto:  dto.ReqSearch{},
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountImport,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountImport), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      true,                                         //是否需要登录
		NeedPermission: true,                                         //是否需要鉴权
		PermissionName: "UserAccount." + enums.BtnAuthImport,         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "导入用户",
			Description: "",
			RequestDto:  dto.ReqSearch{},
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountImportTemplateFile,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountImportTemplateFile), //对应控制器
		HttpType:       HttpPost,                                                 //http请求类型
		NeedLogin:      true,                                                     //是否需要登录
		NeedPermission: false,                                                    //是否需要鉴权
		PermissionName: "UserAccount." + enums.BtnAuthImport,                     //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "获取导入用户模板文件",
			Description: "",
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountExport,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountExport), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      true,                                         //是否需要登录
		NeedPermission: true,                                         //是否需要鉴权
		PermissionName: "UserAccount." + enums.BtnAuthExport,         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "导出用户",
			Description: "",
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountUserAccountCancelUser,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountUserAccountCancelUser), //对应控制器
		HttpType:       HttpPost,                                                    //http请求类型
		NeedLogin:      false,                                                       //是否需要登录
		NeedPermission: false,                                                       //是否需要鉴权
		PermissionName: "",                                                          //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "UserAccountUserAccountCancelUser",
			RequestDto:  requestdto.UserAccountUserAccountCancelUser{},
			Description: "",
		},
	})
	
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountUserAccountGetAppInfo,               //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountUserAccountGetAppInfo), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      false,                                         //是否需要登录
		NeedPermission: false,                                         //是否需要鉴权
		PermissionName: "" ,           //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "UserAccountUserAccountGetAppInfo",
			RequestDto:  requestdto.UserAccountUserAccountGetAppInfo{},
			Description: "",
		},
	})
	
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountLoginHuawei,               //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountLoginHuawei), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      false,                                         //是否需要登录
		NeedPermission: false,                                         //是否需要鉴权
		PermissionName: "" ,           //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "UserAccountLoginHuawei",
			RequestDto:  requestdto.UserAccountLoginHuawei{},
			Description: "",
		},
	})
	
	AppendRouter(ItemInfo{
		Path:           apis.ApiUserAccountGetInfo,               //api路径
		Handlers:       ginp.ConvHandler(custctrl.UserAccountGetInfo), //对应控制器
		HttpType:       HttpPost,                                     //http请求类型
		NeedLogin:      false,                                         //是否需要登录
		NeedPermission: false,                                         //是否需要鉴权
		PermissionName: "" ,           //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "UserAccountGetInfo",
			RequestDto:  requestdto.UserAccountGetInfo{},
			Description: "",
		},
	})
	//{{append}}




}
